// -------------------------------------------------------------------------------
// IRCReporter v1.1
// -------------------------------------------------------------------------------

*1 -- Install
*2 -- Info
*3 -- Servers
*4 -- Config
*5 -- Problems
*6 -- Notes

// -------------------------------------------------------------------------------
// 1 -- Install
// -------------------------------------------------------------------------------

Extract the contents of this archive to your UT2003/System directory.


// -------------------------------------------------------------------------------
// 2 -- Info
// -------------------------------------------------------------------------------

IRCReporter is a serverside IRC reporter bot. It will sit in an IRC channel and report what is happening in the current match to the channel.

It's that simple.

IRCReporter requires patch 2136.

Changes since version 1.0:
	- Configurable buffer now included, should help prevent flooding on sensitive IRC networks. If alot happens the IRC may lag in respect to
	  the game, but it will catch up during a period when not much happens.
	- Configurable teamnames now included.
	- Colours used can now be changed.
	- STFU command changed to Quiet.
	- Bot will now change topic, if it can. And if it cant it will keep trying. Will also set topic back if someone screws with it ...
	- Speak command now shows your name in game. No more anonymous insults.
	- Custom colours for Team 0 and Team 1. (Red/Blue by default).
	- Scoreboard layout changed. Now looks alot neater and lines up, if you use a fixed width font.
	- All new stuff configurable through IRC.


// -------------------------------------------------------------------------------
// 3 -- Servers
// -------------------------------------------------------------------------------

No serverpackages needed for this, it's a serverside mutator.

Just add a ServerActors=IRCReporter.IRC_Main line under the [Engine.GameEngine] section of your INI.

And you're done!

You will want to read the configuration section below though...


// -------------------------------------------------------------------------------
// 4 -- Config
// -------------------------------------------------------------------------------

IRCReporter can be configured through three methods: Editing the INI file, console commands while logged in as admin, and commands while it is logged in on IRC.

INI
-----------
For the INI file, you need to do some things manually.
Copy the text below into your server's INI file, editing it as appropriate:
(note that BotPort is the port on the IRC server it connects to).

[IRCReporter.IRC_Main]
botname=IRCReport			<--- The bot's Nick.
BotServer=irc.quakenet.eu.org		<--- The server the bot connects to.
BotChannel=#IRCReporterBot.00		<--- The channel on the server the bot joins.
BotIdent=IRCBOT				<--- The bot's ident.
BotPort=6667				<--- The port on the server the bot connects to.
ScoreFrequency=120			<--- How frequently score updates are shown.
BotPassword=p4ssw0rd			<--- The bots password, needed for changing settings through IRC
RejoinOnKick=True			<--- Should the bot rejoin a channel when kicked?
ShouldShowKills=True			<--- Should the bot show kills?
bChangeTopic=True			<--- Should the bot attempt to change the topic of the channel?
PerformCommands=MSG IRCReport w00t!	<--- Perform commands. Executed on channel join. Add as many "PerformCommands=XXYYYZZZ" lines as needed.
					     Use to ident to service bots and request ops?

[IRCReporter.IRC_Reporter]
bQuiet=False				<--- Should the bot be quiet (not say anything)
TimeColour=10				<--- The IRC colour code for time. Excluding that odd character, just put in the number.
AnnounceColour=7			<--- The IRC colour code for announcements.
Team0Colour=4				<--- The IRC colour code for Team 0 (which is normally RED)
Team1Colour=12				<--- The IRC colour code for Team 1 (which is normally BLUE)
Team0Name=RED				<--- The team name displayed for team 0. Default is RED.
Team1Name=BLUE				<--- The team name displayed for team 1. Default is BLUE.
EventColour=6				<--- The IRC colour code for events (pickup flag, etc).
StdColour=14				<--- The IRC colour code for the "inbetween" bits. Gray by default.
NoTeamColour=2				<--- The IRC colour code for non-teamed people. Used in DM and other FFA gametypes mainly.
GameMessageColour=3			<--- The IRC colour code for game events -- Joins, etc,
BufferTime=1.25				<--- Time between each sending of a buffered message in seconds.

CONSOLE
-----------
Adjustments through the console can be done after logging in as admin. Once you
are logged in you can use these commands:
	Admin Set IRCReporter.IRC_Main BotName <new name>
	Admin Set IRCReporter.IRC_Main BotServer <new server>
	Admin Set IRCReporter.IRC_Main BotPort <new Port>
	Admin Set IRCReporter.IRC_Main BotChannel <new channel>
	Admin Set IRCReporter.IRC_Main BotIdent <new ident>
	Admin Set IRCReporter.IRC_Main ScoreFrequency <time between score updates in seconds. 0 turns them off>
	Admin Set IRCReporter.IRC_Main BotPassword <NewPassword>
	Admin Set IRCReporter.IRC_Main RejoinOnKick 1/0 (1 is yes, 0 is no)
	Admin Set IRCReporter.IRC_Main ShouldShowKills 1/0 (1 is yes, 0 is no)
	Admin Set IRCReporter.IRC_Main bChangeTopic 1/0 (1 is yes, 0 is no)
Commit and execute your changes using:
	Admin Set IRCReporter.IRC_Main ExecuteChanges 1
The bot will then disconnect from IRC, and reconnect with your new settings.

IRC
-----------
For changing settings through IRC, you use commands in the format:
	/MSG <BotName> <Password> <command> <setting (optional is some cases)>
For example:
	/MSG IRCReport p4ssw0rd BotName ISmell
The following is a list of all possible IRC commands, and what they do:
	/MSG <BotName> <Password> BotName <Newname> 			  <--- Changes the bots name.
	/MSG <BotName> <Password> BotServer <NewServer>  		  <--- Changes the bots IRC server.
	/MSG <BotName> <Password> BotIdent <NewIdent>  			  <--- Changes the bots ident.
	/MSG <BotName> <Password> BotChannel <#NewChannel>  		  <--- Changes the bots channel.
	/MSG <BotName> <Password> BotPort <NewPort>  			  <--- Changes the bots port.
	/MSG <BotName> <Password> ScoreUpdateFreq <NewFrequency>  	  <--- Changes the time between score updates (seconds). 0 turns them off.
	/MSG <BotName> <Password> ShowKills 0/1 -- (1 is yes, 0 is no)    <--- Changes whether the bot should show kills or not
	/MSG <BotName> <Password> RejoinOnKick 0/1 -- (1 is yes, 0 is no) <--- Should the bot rejoin when kicked?
	/MSG <BotName> <Password> BufferTime x				  <--- Changes how long between sending of buffered text in seconds.

In some cases it is necessary to use:
	/MSG <BotName> <Password> ExecuteChanges
To save and execute any changes you have made.

Additionally, you can perform these commands:
	/MSG <BotName> <Password> Speak <text>				   <--- Makes the bot speak out in-game.
	/MSG <BotName> <Password> Quiet 1/0 				   <--- Makes the bot cease to show anything.
	/MSG <BotName> <Password> Rejoin 				   <--- The bot will rejoin the channel if it's not in it.
	/MSG <BotName> <Password> Op <nick> 				   <--- The bot will op the person.
	/MSG <BotName> <Password> SetTeam0Name <name>			   <--- Allows you to set a custom name for team 0 (Red). Clan tag maybe?
	/MSG <BotName> <Password> SetTeam1Name <name>			   <--- Allows you to set a custom name for team 1 (Blue).
	/MSG <BotName> <Password> SetTeam0Colour <IRC Colour Code>	   <--- Set the colour team 0 names should be displayed in.
	/MSG <BotName> <Password> SetTeam1Colour <IRC Colour Code>	   <--- Set the colour team 1 names should be displayed in.
	/MSG <BotName> <Password> SetNoTeamColour <IRC Colour Code>	   <--- Set the colour teamless names should be displayed in.
	/MSG <BotName> <Password> SetTimeColour <IRC Colour Code>	   <--- Set the colour the time should be displayed in. No funny character needed.
	/MSG <BotName> <Password> SetAnnounceColour <IRC Colour Code>	   <--- Set the colour announcements should be displayed in.
	/MSG <BotName> <Password> SetStdColour <IRC Colour Code>	   <--- Set the standard colour should be displayed in.
	/MSG <BotName> <Password> SetEventColour <IRC Colour Code>	   <--- Set the colour events should be displayed in.
	/MSG <BotName> <Password> SetGameMessageColour <IRC Colour Code>   <--- Set the colour game messages should be displayed in.

There are three avaliable public commands, these are:
	.GameInfo -- Displays info about the game
	.AllScores -- Displays all scores.
	.TeamScores -- Displays team scores


// -------------------------------------------------------------------------------
// 5 -- Problems
// -------------------------------------------------------------------------------

If your bot, for some reason, fails to connect to IRC, you can tell it to re-try by logging in as admin, and using this command:
		Admin Set IRCReporter.IRC_Main ExecuteChanges 1

If it still fails, check the following:
	-Does your server allow you to make outgoing connections to IRC servers?
	-Is it being stopepd by a firewall?
	-Is the name you have chosen for your bot taken?
	-Is the server you want it to connect to working?

... and if after all that it _STILL_ fails, email me and I'll find the problem. Please include a server log.

Please check that the IRC server has not died/is still connectable by loading up your IRC client, and connecting to the server yourself.


// -------------------------------------------------------------------------------
// 6 -- Notes
// -------------------------------------------------------------------------------

IRCReporter by [-will-] <will@spambox.co.uk>
Don't hesitate to email me bugs, suggestions, and comments.

